#include <linux/kthread.h>
#include <linux/printk.h>
#include <linux/delay.h>

#include <msh/export.h>

static int kfunc(void *param)
{
    int cnt = 20;

    printk("kthread started\n");

    while (cnt > 0)
    {
        msleep(1000);
        printk("kthread running %d\n", cnt--);
    }

    return 0;
}

static int kthrun(void)
{
    kthread_run(kfunc, NULL, "kthread_test");

    return 0;
}
MSH_CMD_EXPORT(kthrun, test kthread);
